<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
    function disptime(){
        var today = new Date();  
        var hour = today.getHours(); 
        var minute = today.getMinutes();
        var year=today.getFullYear();
        var month=today.getMonth()+1;
        var day=today.getDate();
        if(13<=hour && hour<19){
            document.write('下午好! 欢迎光临！'+'<br>');}
        if(19<=hour && hour<23){
            document.write('晚上好！ 欢迎光临！'+'<br>');}
        if(00<=hour && hour<13){
            document.write('上午好！ 欢迎光临！'+'<br>');}
        document.write('今天日期：'+year+'年'+month+'月'+day+'日'+'<br>'); 
        document.write('现在时间：'+hour +"时"+minute+"分"); 
        }
        disptime();
    </script>      
</body>
</html>